import { http } from '@/utils/http'

export const wxSimpleLogin = (data:string) => {
  return http({
    method: 'GET',
    url: 'goods/goodsInfo/wxGetGoodsListBySelectId',
    data,
  })
}

export type addressInfo = {
  id: string
  receiver: string
  phone: string
  provinceCode: number
  cityCode: number
  countyCode: number
  detailAddress: string
  isDefault: number
  fullLocation: string
  userId: string
  createTime: string
}

export const wxAppGetwxUserAdrData = () => {
  return http<addressInfo[]>({
    method: 'GET',
    url: 'user/address/wxAppGetwxUserAdr',
    data:{},
  })
}

export const wxAppAddwxUserAdrData = (data:addressInfo) => {
  return http<string>({
    method: 'POST',
    url: 'user/address/wxAppAddwxUserAdr',
    data,
  })
}

export const wxAppGetwxUserAdrByIdData = (id:string) => {
  return http<addressInfo>({
    method: 'GET',
    url: 'user/address/wxAppGetwxUserAdrById',
    data:{id},
  })
}

export const wxAppDelwxUserAdrData = (id:string) => {
  return http<string>({
    method: 'POST',
    url: 'user/address/wxAppDelwxUserAdr?id='+id,
    data:{},
  })
}
